﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SN.Data;
using SN.Core;
using System.Data;

namespace Agro.Services {
    public interface IBaseService {

        IList<T> GetPageList<T>(WhereClip where, QueryBase query)
           where T : Entity;
        /// <summary>
        /// 获取单个实体
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="where"></param>
        /// <returns></returns>
        T GetEntity<T>(WhereClip where)
            where T : Entity;

        IList<T> GetEntityList<T>(WhereClip where)
            where T : Entity;

        /// <summary>
        /// 获取列表数据
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="where"></param>
        /// <returns></returns>
        IList<T> GetEntityList<T>(WhereClip where, QueryBase query)
            where T : Entity;
        /// <summary>
        /// 获取某个字段的值
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="field"></param>
        /// <param name="where"></param>
        /// <returns></returns>
        object GetField<T>(Field field, WhereClip where)
            where T : Entity;

        /// <summary>
        /// 获取所属单位
        /// </summary>
        /// <param name="organizationid">单位编号</param>
        /// <returns>单位名称</returns>
        string GetOrganizationName(string organizationid);

        DataTable GetPageData(string commangText, QueryBase query);

        /// <summary>
        /// 获取上一年，上一月，上一季度的上报截止日期
        /// </summary>
        /// <returns></returns>
        IDictionary<string, DateTime> GetAllDeadline();
    }
}
